package deckofcards;


/**
 *
 * @author UnicusAnimus
 */
public class DeckOfCards {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int [] deck = new int [52];
        String [] suits = {"PĪĶIS", "ERCENS", "KĀROVS", "KREICIS"};
        String [] ranks = {"TŪZIS", "2", "3", "4", "5", "6", "7", "8",
            "9", "10", "KALPS", "DĀMA", "KARALIS"};
        
        for(int i = 0; i < deck.length; i++)
            deck[i] = i;
        
        for(int i = 0; i < deck.length; i++) {
            int index = (int)(Math.random() * deck.length);
            int temp = deck[i];
            deck[i] = deck[index];
            deck[index] = temp;
        }
        
        for(int i = 0; i < 4; i++) {
            String suit = suits[deck[i] / 13];
            String rank = ranks[deck[i] % 13];
            System.out.println("Izspēlētā kārts ir "
                    + suit + "  " + rank);
        }
    }
}
